package com.youth.orderservice.Client;

import com.youth.ClientEntity.UserEntity;
import com.youth.orderservice.Client.Impl.UserClientFallback;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.HashMap;

@Component
@FeignClient(name = "service-ucenter",fallback = UserClientFallback.class)
public interface UserClient {

    @ApiOperation(value = "根据memberId获取member的信息")
    @PostMapping("/userservice/member/ByIdGetUser/")
    UserEntity ByIdGetUser(@RequestBody HashMap<String,String> map);

    @ApiOperation(value = "根据用户id和金额去扣减金额-huang-远程")
    @GetMapping("/userservice/member/subtract/{userId}/{money}")
    public boolean subtract(@PathVariable(value = "userId") String userId,
                            @PathVariable(value = "money") String money);

}
